## API Report File for "@backstage/plugin-catalog-import"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="react" />

import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { CatalogApi } from '@backstage/catalog-client';
import { CompoundEntityRef } from '@backstage/catalog-model';
import { ConfigApi } from '@backstage/core-plugin-api';
import { Controller } from 'react-hook-form';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { FieldErrors } from 'react-hook-form';
import { IdentityApi } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { ScmAuthApi } from '@backstage/integration-react';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { SubmitHandler } from 'react-hook-form';
import { TextFieldProps } from '@material-ui/core/TextField/TextField';
import { UnpackNestedValue } from 'react-hook-form';
import { UseFormProps } from 'react-hook-form';
import { UseFormReturn } from 'react-hook-form';

// @public
export type AnalyzeResult =
  | {
      type: 'locations';
      locations: Array<{
        target: string;
        exists?: boolean;
        entities: CompoundEntityRef[];
      }>;
    }
  | {
      type: 'repository';
      url: string;
      integrationType: string;
      generatedEntities: PartialEntity[];
    };

// @public
export const AutocompleteTextField: <TFieldValue extends string>(
  props: AutocompleteTextFieldProps<TFieldValue>,
) => React_2.JSX.Element;

// @public
export interface AutocompleteTextFieldProps<TFieldValue extends string> {
  // (undocumented)
  errorHelperText?: string;
  // (undocumented)
  errors?: FieldErrors;
  // (undocumented)
  helperText?: React_2.ReactNode;
  // (undocumented)
  loading?: boolean;
  // (undocumented)
  loadingText?: string;
  // (undocumented)
  name: TFieldValue;
  // (undocumented)
  options: string[];
  // (undocumented)
  required?: boolean;
  // (undocumented)
  rules?: React_2.ComponentProps<typeof Controller>['rules'];
  // (undocumented)
  textFieldProps?: Omit<TextFieldProps, 'required' | 'fullWidth'>;
}

// @public
export interface CatalogImportApi {
  // (undocumented)
  analyzeUrl(url: string): Promise<AnalyzeResult>;
  // (undocumented)
  preparePullRequest?(): Promise<{
    title: string;
    body: string;
  }>;
  // (undocumented)
  submitPullRequest(options: {
    repositoryUrl: string;
    fileContent: string;
    title: string;
    body: string;
  }): Promise<{
    link: string;
    location: string;
  }>;
}

// @public
export const catalogImportApiRef: ApiRef<CatalogImportApi>;

// @public
export class CatalogImportClient implements CatalogImportApi {
  constructor(options: {
    discoveryApi: DiscoveryApi;
    scmAuthApi: ScmAuthApi;
    identityApi: IdentityApi;
    scmIntegrationsApi: ScmIntegrationRegistry;
    catalogApi: CatalogApi;
    configApi: ConfigApi;
  });
  // (undocumented)
  analyzeUrl(url: string): Promise<AnalyzeResult>;
  // (undocumented)
  preparePullRequest(): Promise<{
    title: string;
    body: string;
  }>;
  // (undocumented)
  submitPullRequest(options: {
    repositoryUrl: string;
    fileContent: string;
    title: string;
    body: string;
  }): Promise<{
    link: string;
    location: string;
  }>;
}

// @public
export const CatalogImportPage: () => JSX_2.Element;

// @public
const catalogImportPlugin: BackstagePlugin<
  {
    importPage: RouteRef<undefined>;
  },
  {}
>;
export { catalogImportPlugin };
export { catalogImportPlugin as plugin };

// Warning: (ae-forgotten-export) The symbol "StepperProvider" needs to be exported by the entry point index.d.ts
//
// @public
export function defaultGenerateStepper(
  flow: ImportFlows,
  defaults: StepperProvider,
): StepperProvider;

// @public
export const DefaultImportPage: () => React_2.JSX.Element;

// @public
export const EntityListComponent: (
  props: EntityListComponentProps,
) => React_2.JSX.Element;

// @public
export interface EntityListComponentProps {
  // (undocumented)
  collapsed?: boolean;
  // (undocumented)
  firstListItem?: React_2.ReactElement;
  // (undocumented)
  locationListItemIcon: (target: string) => React_2.ReactElement;
  // (undocumented)
  locations: Array<{
    target: string;
    entities: (Entity | CompoundEntityRef)[];
  }>;
  // (undocumented)
  onItemClick?: (target: string) => void;
  // (undocumented)
  withLinks?: boolean;
}

// @public
export type ImportFlows =
  | 'unknown'
  | 'single-location'
  | 'multiple-locations'
  | 'no-location';

// @public
export const ImportInfoCard: (
  props: ImportInfoCardProps,
) => React_2.JSX.Element;

// @public
export interface ImportInfoCardProps {
  // (undocumented)
  exampleLocationUrl?: string;
  // (undocumented)
  exampleRepositoryUrl?: string;
}

// Warning: (ae-forgotten-export) The symbol "State" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ImportState" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type ImportState = State & {
  activeFlow: ImportFlows;
  activeStepNumber: number;
  analysisUrl?: string;
  onGoBack?: () => void;
  onReset: () => void;
};

// @public
export const ImportStepper: (props: ImportStepperProps) => React_2.JSX.Element;

// @public
export interface ImportStepperProps {
  // (undocumented)
  generateStepper?: (
    flow: ImportFlows,
    defaults: StepperProvider,
  ) => StepperProvider;
  // (undocumented)
  initialUrl?: string;
  // (undocumented)
  variant?: InfoCardVariants;
}

// @public
export const PreparePullRequestForm: <TFieldValues extends Record<string, any>>(
  props: PreparePullRequestFormProps<TFieldValues>,
) => React_2.JSX.Element;

// @public
export type PreparePullRequestFormProps<
  TFieldValues extends Record<string, any>,
> = Pick<UseFormProps<TFieldValues>, 'defaultValues'> & {
  onSubmit: SubmitHandler<TFieldValues>;
  render: (
    props: Pick<
      UseFormReturn<TFieldValues>,
      'formState' | 'register' | 'control' | 'setValue'
    > & {
      values: TFieldValues;
    },
  ) => React_2.ReactNode;
};

// @public
export type PrepareResult =
  | {
      type: 'locations';
      locations: Array<{
        exists?: boolean;
        target: string;
        entities: CompoundEntityRef[];
      }>;
    }
  | {
      type: 'repository';
      url: string;
      integrationType: string;
      pullRequest: {
        url: string;
      };
      locations: Array<{
        target: string;
        entities: CompoundEntityRef[];
      }>;
    };

// @public
export const PreviewCatalogInfoComponent: (
  props: PreviewCatalogInfoComponentProps,
) => React_2.JSX.Element;

// @public
export interface PreviewCatalogInfoComponentProps {
  // (undocumented)
  classes?: {
    card?: string;
    cardContent?: string;
  };
  // (undocumented)
  entities: Entity[];
  // (undocumented)
  repositoryUrl: string;
}

// @public
export const PreviewPullRequestComponent: (
  props: PreviewPullRequestComponentProps,
) => React_2.JSX.Element;

// @public
export interface PreviewPullRequestComponentProps {
  // (undocumented)
  classes?: {
    card?: string;
    cardContent?: string;
  };
  // (undocumented)
  description: string;
  // (undocumented)
  title: string;
}

// @public
export const StepInitAnalyzeUrl: (
  props: StepInitAnalyzeUrlProps,
) => React_2.JSX.Element;

// @public
export interface StepInitAnalyzeUrlProps {
  // (undocumented)
  analysisUrl?: string;
  // (undocumented)
  disablePullRequest?: boolean;
  // (undocumented)
  exampleLocationUrl?: string;
  // (undocumented)
  onAnalysis: (
    flow: ImportFlows,
    url: string,
    result: AnalyzeResult,
    opts?: {
      prepareResult?: PrepareResult;
    },
  ) => void;
}

// @public
export const StepPrepareCreatePullRequest: (
  props: StepPrepareCreatePullRequestProps,
) => React_2.JSX.Element;

// @public
export interface StepPrepareCreatePullRequestProps {
  // (undocumented)
  analyzeResult: Extract<
    AnalyzeResult,
    {
      type: 'repository';
    }
  >;
  // (undocumented)
  onGoBack?: () => void;
  // (undocumented)
  onPrepare: (
    result: PrepareResult,
    opts?: {
      notRepeatable?: boolean;
    },
  ) => void;
  // Warning: (ae-forgotten-export) The symbol "FormData_2" needs to be exported by the entry point index.d.ts
  //
  // (undocumented)
  renderFormFields: (
    props: Pick<
      UseFormReturn<FormData_2>,
      'register' | 'setValue' | 'formState'
    > & {
      values: UnpackNestedValue<FormData_2>;
      groups: string[];
      groupsLoading: boolean;
    },
  ) => React_2.ReactNode;
}

// Warnings were encountered during analysis:
//
// src/api/CatalogImportApi.d.ts:25:5 - (ae-forgotten-export) The symbol "PartialEntity" needs to be exported by the entry point index.d.ts
```
